package com.hust.bridgecheck.repository;

import com.hust.bridgecheck.entity.WarningData;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface WarningDataRepository extends JpaRepository<WarningData,Integer> {
    //获取当前传感器ID未清除的数据
    @Query(nativeQuery = true, value = "select * from warning_data where paraid = ?1")
    List<WarningData> getWarningDataByParaId(String paraid);

    //获取当前桥未清除的数据
    @Query(nativeQuery = true, value = "select * from warning_data where bridgeid = ?1")
    List<WarningData> getWarningDataByBridgeID(Integer bridgeid);
}
